package com.itcast.n3_类的加载器;

/**
 * @program: jvm
 * @description:
 * @author: flyduck
 * @create: 2024-09-03 14:39
 **/
public class Test08_验证自定义String类后_加载的还是rt里面String类 {
    public static void main(String[] args) throws ClassNotFoundException {
        ClassLoader classLoader1 = Test08_验证自定义String类后_加载的还是rt里面String类.class.getClassLoader();
        System.out.println("本类的类加载器 = " + classLoader1);//sun.misc.Launcher$AppClassLoader@14dad5dc
        Class<?> clazz = classLoader1.loadClass("java.lang.String");
        ClassLoader classLoader2 = clazz.getClassLoader();
        System.out.println("String类加载器 = " + classLoader2);//null
    }
}
